package gat.convertor.backgroundUser;

import com.bitsun.core.common.convertor.IConvertor;
import com.bitsun.core.common.persistence.Pager;
import gat.domain.model.backgroundUser.PermissionsEntity;
import gat.dto.res.backgroundUser.PermissionsResDto;
import gat.infrastructure.persistence.po.backgroundUser.PermissionsPo;
import org.mapstruct.Mapper;

/**
 * 权限表
 * @author: tmac
 * @email: tmac
 */

@Mapper(componentModel="spring")
public abstract class PermissionsResDtoConvertor implements IConvertor<PermissionsResDto, PermissionsEntity, PermissionsPo> {

    public Pager<PermissionsResDto> convertPoPager2ResDtoPager(Pager<PermissionsPo> poPager) {
        if (poPager == null) {
            return null;
        }

        Pager<PermissionsResDto> resDtoPager = new Pager();
        resDtoPager.setTotalCount(poPager.getTotalCount());
        resDtoPager.setPageSize(poPager.getPageSize());
        resDtoPager.setTotalPage(poPager.getTotalPage());
        resDtoPager.setCurrentPage(poPager.getCurrentPage());
        resDtoPager.setList(poList2DtoList(poPager.getList()));

        return resDtoPager;
    }
}








